{include file="public/header" /}
<style>
    .index-list li{
        width: 100% !important;
    }
    .index-list .multi {
        line-height: 2.25rem;
    }
    .licontent{
       padding: 0px !important; 
       margin-top: 5px;
    }
</style>
<body class="bgc hide-top">
<div class="pro-list-search">
    <i class="layui-icon layui-icon-left"  onclick="history.go(-1)"></i>
    <div class="rgt">
        <img src="/static/index/img/icon43.png" alt="">
        <input type="text" class="keyword" placeholder="请输入搜索抢红包" value="{$keyword?:''}">
        <p class="flex-center search_bt">搜索</p>
    </div>
</div>

<div class="tpl_list"></div>

<script id="template" type="text/html">
    {{# if(d.data.length > 0){ }}
    <ul class="index-list">
        {{# for(var i = 0; i < d.data.length; i++){ }}
        <li>
            <a href="{:url('packet/details')}?id={{d.data[i].id}}">
                <div>
                    <p class="multi">{{d.data[i].title}}</p>
                    <p class="price">金额：￥<span>{{d.data[i].price}}</span></p>
                    <div class="licontent">
                        <span>总库存：{{d.data[i].stock}} </span>
                        <span style=" margin-left:30px;">剩余库存：{{d.data[i].end_stock}}</span>
                    </div>
                    <div class="licontent">
                        <span>收益周期：{{d.data[i].day}} 天</span>
                    </div>
                    <div class="licontent">
                        <span>收益率：{{d.data[i].sytitle}} %</span>
                    </div>
                    <div class="licontent">
                        <span>到期总收益：{{d.data[i].sytoaltitle}}</span>
                    </div>
                </div>
            </a>
        </li>
        {{# } }}
    </ul>
    {{# }else { }}
    <div class="pro-list-data">
        <img src="/static/index/img/icon44.png" alt="">
        <p>暂无搜索结果</p>
    </div>
    {{# } }}
</script>

</body>
{include file="public/footer"/}
<script>
    $(function () {
        var end = '{$keyword?:""}' ? '没有更多了' : '没有更多了';
        getFlow(1, "{:url('packet/getList')}?keyword={$keyword?:''}", 'template', end);

        $(".search_bt").click(function () {
            var keyword = $(".keyword").val();
            /*if (!keyword) {
                layer.msg('请填写要搜索的内容');
                return false;
            }*/
            $(".tpl_list").empty();
            getFlow(1, "{:url('packet/getList')}?keyword=" + keyword, 'template', end);
        });
    })
</script>
</html>